package com.jixiang.dictionary.controller;



import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jixiang.model.common.dtos.ResponseResult;
import com.jixiang.model.dictionary.entity.DsLayoutMenu;
import com.jixiang.dictionary.service.DsLayoutMenuService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

/**
 * (DsLayoutMenu)表控制层
 *
 * @author makejava
 * @since 2023-10-15 17:00:56
 */
@RestController
@RequestMapping("layoutMenu")
public class DsLayoutMenuController extends ApiController {
    /**
     * 服务对象
     */
    @Resource
    private DsLayoutMenuService dsLayoutMenuService;

    /**
     * 管理端获取菜单页
     *
     */
    @ApiOperation("前台页面获取页面菜单页")
    @GetMapping("/appGetDsLayoutMenu")
    public ResponseResult appGetDsLayoutMenu(){
        return dsLayoutMenuService.appGetDsLayoutMenu();
    }

    /**
     * 管理端获取菜单页
     *
     */
    @ApiOperation("管理端获取页面菜单页")
    @GetMapping("/adminGetDsLayoutMenu")
    public ResponseResult adminGetDsLayoutMenu(){
        return dsLayoutMenuService.adminGetDsLayoutMenu();
    }

    /**
     * 添加菜单页
     *
     */
    @ApiOperation("管理端添加页面菜单页")
    @PostMapping("/addDsLayoutMenu")
    public ResponseResult addDsLayoutMenu(@RequestBody(required = true)DsLayoutMenu dsLayoutMenu){
        return dsLayoutMenuService.addDsLayoutMenu(dsLayoutMenu);
    }

    /**
     * 添加菜单页
     *
     */
    @ApiOperation("管理端获取页面菜单ById")
    @GetMapping("/getDsLayoutMenuById")
    public ResponseResult getLayoutMenuById(@RequestParam(required = true,value = "id")String id){
        return dsLayoutMenuService.getLayoutMenuById(id);
    }

    /**
     * 修改菜单页
     *
     */
    @ApiOperation("管理端修改菜单页")
    @PostMapping("/updateDsLayoutMenu")
    public ResponseResult updateLayoutMenu(@RequestBody(required = true)DsLayoutMenu dsLayoutMenu){
        return dsLayoutMenuService.updateLayoutMenu(dsLayoutMenu);
    }

    /**
     * 删除菜单页
     *
     */
    @ApiOperation("管理端删除菜单页")
    @DeleteMapping("/delDsLayoutMenuById")
    public ResponseResult deleteLayoutMenuDataById(@RequestParam(required = true,value = "id")String id){
        return dsLayoutMenuService.deleteLayoutMenuDataById(id);
    }

}

